<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>

<%@ page import="com.easyui.common.UserLogin" %>

<%
	String pno = request.getParameter("pno");
%>

<script type="text/javascript" charset="UTF-8">
	var allDiscussDatagrid;
	$(function(){
		//所有帖子
		allDiscussDatagrid = $('#allDiscussDatagrid').datagrid({
			url:'../servlet/GetDiscussServlet?pno=' + <%= pno %>,
			fitColumns:true,
			nowrap:false,
			//striped:true,
			idField:'nno',
			pagination:true,
			pageSize:10,
			pageList:[10,20,30],
			fit:true,
			border:false,
			sortName:'nno',
			sortOrder:'desc',
			//showFooter:true,
			columns:[[{
				field:'nno',
				checkbox:true
			},{
				title:'标题',
				field:'ntitle',
				width:100,
				sortable:true,
				formatter: function(value,rowData,rowIndex){
		            return '<a href="discussDetail.jsp?nno=' + rowData.nno + '&page=1" target="_blank" style="text-decoration: none;">'+ value +'</a>';
		     	} 
			},{
				title:'发布者',
				field:'pubname',
				width:50
			},{
				title:'创建时间',
				field:'ptime',
				width:100,
				sortable:true
			},{
				title:'回复数',
				field:'replyNum',
				width:40
			},{
				title:'最后更新时间',
				field:'ltime',
				width:100,
				sortable:true
			}]],
			toolbar:[{
				text:'取消',
				iconCls:'icon-undo',
				handler:function(){
					allDiscussDatagrid.datagrid('unselectAll');
					allDiscussDatagrid.datagrid('rejectChanges');
				}
			},'-',{
				text:'刷新',
				iconCls:'icon-reload',
				handler:function(){
					allDiscussDatagrid.datagrid('unselectAll');
					allDiscussDatagrid.datagrid('rejectChanges');
					allDiscussDatagrid.datagrid('load');
				}
			},'-']
		});
		
	});
	
</script>


<table id="allDiscussDatagrid" fit="true"></table>
			
